# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=sopel
pkgver=7.0.4
pkgrel=0
pkgdesc="An easy-to-use and highly extensible IRC Bot framework"
url="https://sopel.chat/"
arch="noarch"
license="EFL-2.0"
depends="python3 ipython py3-requests py3-geoip2 py3-setuptools py3-enchant py3-dnspython
	py3-xmltodict py3-praw py3-tz"
makedepends="py3-pbr"
checkdepends="py3-pytest"
install="$pkgname.pre-install"
pkgusers="sopel"
pkggroups="sopel"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sopel-irc/sopel/archive/v$pkgver.tar.gz
	add-tpaste-us.patch
	sopel.initd
	sopel.conf
	update-requirements.patch"
options="!check" # test suite issues


build() {
	python3 setup.py build
}

check() {
	python3 pytest_run.py sopel test
}

package() {
	python3 setup.py install --root="$pkgdir"
	install -Dm0755 "$srcdir"/sopel.initd "$pkgdir"/etc/init.d/sopel
	install -Dm0644 "$srcdir"/sopel.conf "$pkgdir"/etc/conf.d/sopel
}

sha512sums="1674d2f9f5040d0697e10f9961a8d83c87429b6fc1b93c53157d60addd0b5476ac3aac2fa33d123089710e07f332acfec402b0d7da0e2cb1849b9d47843d62da  sopel-7.0.4.tar.gz
6095cbdb1d9e0b4c0ae91febb86637cf9a9f88ae04461fd81af15c23e6ca2f410231308ec76012fb8c0e28818967cebc92a0c2799add6aa564299e9fb79b8793  add-tpaste-us.patch
1d6b39697d767085530f1db5ba763554c6503ab82b792bdb48c7fef65e4424fe30740ab758ebd3f1ccdd6f2340a9ac9e3dfe44fff064969106717169160ece7b  sopel.initd
d90379dc5a2d8c8ff52a15d1c341d4cbad919707fadc578d4ae78db45efafad5e6add270876aa982086ac78d99729b0346aa565512190b9fc8cd77020ba91445  sopel.conf
849b0bf3566a5cc21f576312839dcc6862766b90f7e4ffd769a815ba9b75435fbd7ae84a8d419012ccab6997de00ca0707859be9b701119b9325c75a3bb4eb2d  update-requirements.patch"
